'use strict';

function collect_max_number(collection) {
  let result=collection.reduce(function(item1,item2){
    if(item1>=item2){
      return item1;
    }
    else{
      return item2;
    }
  });
  console.log(result);
  return result;
}

module.exports = collect_max_number;
collect_max_number([1, 2, 3, 4, 5]);